1. Field of the Invention
This present invention relates generally to systems for processing MPEG-2 digital video streams/data, and particularly, to a system for splicing and spot insertion in MPEG-2 video streams.
2. Discussion of the Prior Art
The MPEG-2 standards cover three parts: systems, video and audio. Systems are defined by the recommendation ITU-T Rec. H.222.0 ISO/IEC 13818-1: Information technology—Generic coding of moving pictures and associated audio—Systems. The recommendation for video is the ITU-T Rec. H.262 ISO/IEC 13818-2: Information technology—Generic coding of moving pictures and associated audio—Video. The audio portion is covered by the recommendation ISO/IEC 13818-3: Information technology—Generic coding of moving pictures and associated audio—Audio.
An MPEG-2 stream usually contains three types of video frames: I-frame (intra-coded frame) which is coded using information only from itself, P-frame (predictive-coded frame) which is coded using motion compensated prediction from the past reference frame-like previous I or P frame—and B-frame (bidirectionally predictive-coded frame) which is coded using motion compensated prediction from other past and/or future reference frames—like other I-frames and/or P-frames. A video sequence comprises a sequence of frames arranged in Group of Pictures (GOP). A GOP header is an optional header that can be present immediately before an I-frame to indicate to the decoder if the first consecutive B-frame can be decoded without any other past reference but the last I-frame.
MPEG-2 digital technology is very important for TV broadcasters since it allows for the transmission of more programs per channel than the current analog systems by means of digital compression. It also facilitates the introduction of new services. However, it is required that this new technology support all capabilities of the current system. Current analog CATV systems allow for local advertisement insertion on live broadcast feeds. This kind of capability is not trivial to implement in video streams that are in the compressed domain. The insertion/overlay of a second video stream (e.g., local advertisement) into a first video stream (e.g., live broadcast feed) cannot be done at any random point. The penalty will be the presentation of some artifacts at the viewer side if certain requirements are not met.
Splicing refers to the concatenation performed on two different elementary streams, resulting in a third elementary stream which is also compliant with the MPEG recommendations. The MPEG-2 standard defines some provisions to support splicing. For example, it provides guidelines for determining locations in the stream where there are opportunities to splice, that is, it defines some splice points. However, specifications of the splice points alone is not enough to guarantee a clean splicing (without artifacts) because there is a risk of decoder buffer overflow in the time interval during which bits of both streams are in the buffer. Furthermore, this extra information has to be inserted into the streams during the encoding process.
How often these splice points should occur in a stream is not specified by the standards, which can be a problem in applications where the switch from the first stream to the second stream has to be performed within a certain time and cannot wait until the next splice point occurs. Furthermore, switching from one MPEG-2 stream to another should take into account all the different I, B, P-frame motion vectors and GOPs as well as several kinds of discontinuities: transport header continuity counter discontinuity, temporal reference discontinuity for frame presentation, PCR/PTS/DTS timestamp discontinuity, etc.
Thus, what is needed is a system capable of performing splicing in MPEG-2 data streams that does not necessarily provide any information on splice points, and particularly, one that may determine the splice points by itself and guarantee that the transition from the first to the second video stream will be made with no visual artifacts.
Prior art attempts addressing the splice/spot insertion problem in MPEG-2 data streams may be found in U.S. Pat. No. 5,534,944 which proposes a method of splicing that inserts stuffing information between the last picture of the first stream and the first picture of the second stream. By doing so, it is claimed that there will be no overflow of the decoder buffer when the resulting video stream is received. However, this method does not define how to find the splice points in these streams. It does not take into consideration that a video sequence consists of group of pictures and the switching from one stream to the other cannot be done at any random picture boundary. Further, the method described in U.S. Pat. No. 5,534,944 requires an emulation of the decoder buffer to gather the information needed to calculate the amount of stuffing to be inserted. They do not cover splicing on transport streams where other elementary streams besides video (e.g., audio) can be present and have also to be spliced accordingly (synchronized).
Another proposed solution to the problem is found in U.S. Pat. No. 5,859,660 which describes a method based in insertion of null information between the two streams at the splicing point. The referred solution, however, requires an insertion of a black frame at the splicing point, either by the encoder or by the splicing device, to minimize the visual effects of the transition. Additionally, this prior art method also causes the decoder buffer to be emptied before inserting the second stream which generates a considerable delay between the presentation of the last frame of the first stream and the first frame of the second stream. Further, this method does not address timestamp (PCR, PTS, and DTS) and continuity counter discontinuities occurring at the splicing point.